home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1996
/
MacHack 1996.toast
/
Hacks
/
Hacks ’92
/
Text Capture FKEY
/
FixPC.h
< prev
next >
Wrap
Text File
|
1995-09-10
|
828b
|
23 lines
// This is taken from TN 228. TN 212 recommends using this at the main
// entry point of all INITs and external routines.
pascal void FixPC( void )
= {0x41FA, 0x000A, /* LEA *+$000C,A0 */
0x2008, /* MOVE.L A0,D0 */
0xA055, /* _StripAddress */
0x2040, /* MOVEA.L D0,A0 */
0x4ED0}; /* JMP (A0) ;jmps to next instruction */
// This version is equivalent, but is for inclusion in asm {}.
// The reason for using A1 rather than A0 is so as not to confuse the
// CODE editor in ResEdit.
#define FIXPC \
LEA @fixed_pc, A1\
move.L A1, D0\
StripAddress\
moveA.L D0, A1\
jmp (A1)\
@fixed_pc